<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});


// ******************** sanctum
Route::post('/sanctum/token/{id}', 'Api\Sanctum\TestController@token');

Route::middleware('auth:sanctum')->get('/sanctum/test1', function () {
    return "test1";
});

Route::middleware('auth:sanctum')->post('/sanctum/test2', function () {
    return "test2";
});

// Route::middleware(['auth:sanctum', 'sanctum.guard:users'])->get('/sanctum/test3', function () {
//     return "test3";
// });
